const { DataTypes } = require('sequelize');
const sequelize = require('../db');

exports.bannerModel = sequelize.define(
	'banner',
	{
		midImg: {
			type: DataTypes.STRING,
			allowNull: false,
			comment: '中图'
		},
		bigImg: {
			type: DataTypes.STRING,
			allowNull: false,
			comment: '大图'
		},
		title: {
			type: DataTypes.STRING,
			allowNull: false,
			comment: '标题'
		},
		description: {
			type: DataTypes.STRING,
			allowNull: false,
			comment: '描述'
		}
	},
	{
		freezeTableName: true,
		deletedAt: true,
		defaultScope: {
			attributes: { exclude: ['createdAt', 'updatedAt'] } // 默认排除 createdAt 和 updatedAt 字段
		}
	}
);
